package com.hucais.etl.common.bean;

public enum EsIndex {
    ODS_BOOKINFORMATION(
            new String[]{
                    "isbn", "book_name", "author", "pricing", "category",
                    "publishing_house", "publishing_time", "impression", "edition", "sales_volume",
                    "binding_layout", "format", "number_of_pages", "paper", "number_of_suit",
                    "data_source"
            }
    ),
    OdsBookStore(
            new String[]{
                    "isbn", "name_of_shop", "channel", "slogan", "book_review", "selling_price",
                    "store_pricing", "conditions", "number", "data_source"
            }
    ),
    OdsBookComment(
            new String[]{
                    "store_name", "book_name", "score", "data_source"
            }
    );


    private final String[] colArr;

    EsIndex(String[] colArr) {
        this.colArr = colArr;
    }

    private String[] getColArr() {
        return colArr;
    }

    public String getQueryColList() {
        StringBuilder res = new StringBuilder();
        for (int i = 0; i < getColArr().length; i++) {
            if (i == 0) {
                res.append('"').append(getColArr()[i]).append('"');
            } else {
                res.append(",").append('"').append(getColArr()[i]).append('"');
            }
        }
        return res.toString();
    }
}
